<HTML><HEAD><TITLE>?X &\= ?Y</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(sd)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>?X &\= ?Y</H1>
X is different from Y
<DL>
<DT><EM>X</EM></DT>
<DD>Variable or atomic value
</DD>
<DT><EM>Y</EM></DT>
<DD>Variable or atomic value
</DD>
</DL>
<H2>Description</H2>

	Constrains X and Y to be different. Operationally, the predicate
	delays until one side is instantiated and the other has a domain.
	The instantiated value is then removed from the domain.

<H2>Examples</H2>
<PRE>
    ?- X &amp;:: [red,green,blue], X &amp;\= red.
    X = X{[blue, green]}
    Yes (0.00s cpu)

    ?- X &amp;:: [red, green, blue], X &amp;\= yellow.
    X = X{[blue, green, red]}
    Yes (0.00s cpu)

    ?- X &amp;:: [red,green], X &amp;\= red.
    X = green
    Yes (0.00s cpu)

    ?- X &amp;:: [red,green], X &amp;\= red, X &amp;\= green.
    No (0.00s cpu)

    ?- X &amp;\= red.
    X = X
    There is 1 delayed goal.
    Yes (0.00s cpu)

    ?- X &amp;\= red, X &amp;:: [red,green].
    X = green
    Yes (0.00s cpu)

    ?- [X, Y] &amp;:: [red, green, blue], X &amp;\= Y.
    X = X{[blue, green, red]}
    Y = Y{[blue, green, red]}
    There is 1 delayed goal.
    Yes (0.00s cpu)

    ?- X &amp;:: [red, green], Y &amp;:: [blue, brown], X &amp;\= Y.
    X = X{[green, red]}
    Y = Y{[blue, brown]}
    There is 1 delayed goal.
    Yes (0.00s cpu)

    ?- red &amp;\= green.
    Yes (0.00s cpu)

    ?- red &amp;\= red.
    No (0.00s cpu)
    </PRE>
<H2>See Also</H2>
<A HREF="../../lib/sd/YRE-3.html">&\= / 3</A>, <A HREF="../../lib/sd/YE-2.html">&= / 2</A>
</BODY></HTML>
